<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增公共代码')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
    <div class="form-content">
        <form id="form-ggDm-add" class="form-horizontal">
            <input name="deptId" type="hidden" id="treeId"/>
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>代码名称：</label>
                        <div class="col-sm-8">
                            <input name="dmmc" autocomplete="off" placeholder="请输入代码名称" class="form-control" type="text" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>代码类型：</label>
                        <div class="col-sm-8">
                            <input name="dmtype" autocomplete="off" placeholder="请输入代码类型" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>代码：</label>
                        <div class="col-sm-8">
                            <input name="dm" autocomplete="off" placeholder="请输入代码" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>备注：</label>
                        <div class="col-sm-8">
                            <input name="remark" autocomplete="off" class="form-control" type="text"  placeholder="请输入备注">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">是否有效：</label>
                        <div class="col-sm-8">
                            <div class="input-group " style="width: 100%">
                                <select name="isValid" class="form-control m-b" th:with="type=${@dict.getType('biz_is_valid')}">
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">删除标志：</label>
                        <div class="col-sm-8">
                            <div class="input-group " style="width: 100%">
                                <select name="isDeleted" class="form-control m-b" th:with="type=${@dict.getType('biz_is_delete')}">
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>字段值：</label>
                        <div class="col-sm-8">
                            <input name="val" autocomplete="off" placeholder="请输入字段值" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script>
	    var prefix = ctx + "biz/ggDm";
        
        function submitHandler() {
	        if ($.validate.form()) {
	        	var data = $("#form-ggDm-add").serializeArray();
	        	$.operate.saveTab(prefix + "/add", data);
	        }
	    }
    </script>
</body>
</html>
